# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-asn1
pkgver=0.5.1
pkgrel=0
pkgdesc="Python3 ASN1 library"
url="https://github.com/pyasn1/pyasn1"
arch="noarch"
license="BSD-2-Clause"
depends="python3"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pyasn1/pyasn1-$pkgver.tar.gz"
builddir="$srcdir/pyasn1-$pkgver"

replaces="py-asn1" # Backwards compatibility
provides="py-asn1=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
19478d810d000fb4435f6a1776f290b1618a693539ff8ffad8c41f9ac316938f1c0ae988db8571a838443407d312b5566887e20284a779ccf427888739f13833  pyasn1-0.5.1.tar.gz
"
